#include "types.h"
#include "core.h"
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

extern dSymbol *T;
extern dList *nil;
// Loader
extern "C" void load_module ();

class dGuiObject : public dObject
{
 public:
  string layoutStr;
  GtkWidget *layout;
  GtkWidget *widget;

  dGuiObject ();
  dGuiObject (GtkWidget *newWidget, string newType);
  ~dGuiObject ();
  string toString ();
};

// GTK-related
// Must be called before all other gtk-related methods
void dInitGTK ();

// Starts the GTK loop that must be called after all the gtk widgets have been created
dObject *dStartGTK (dList *args);

// (add-tooltip widget "tooltip")
dObject *add_tooltip (dList *args);

dObject *show_widget (dList *args);
dObject *hide_widget (dList *args);

// (set-layout widget "layout" etc)
dObject *set_widget_layout (dList *args);
// (make-layout "layout" etc)
dObject *make_gtk_layout (dList *args);
// (get-widget-layout widget)
dObject *get_widget_layout (dList *args);
dObject *add_widget (dList *args);

// (make-about-dialog "name" "version" "copyright" "comments" "website")
dObject *make_about_dialog (dList *args);

// (make-window "caption" width height)
dObject *make_gtk_window (dList *args);

// (make-button "label" width height)
dObject *make_gtk_button (dList *args);

// (make-label "label")
dObject *make_gtk_label (dList *args);

// (make-image "image" width height)
dObject *make_gtk_image (dList *args);
